/*****************************************************************************
*        描述 :
*             文件描述
*        CLR版本:            3.5
*        创建者 :            蒋 光
*        个人域名:           jiangguang.net.cn
*        命名空间名称:       ECP.Utilities
*        文件名:             ResourcesSerializer.cs
*        创建系统时间:       2012/11/2 19:07:08
*        创建年份:           2012
*
/*****************************************************************************/

namespace ECP.Utilities
{
    using System.IO;
    using System.Xml.Serialization;

    internal class ResourcesSerializer
    {
        public static Resources DeSerialize(string filePath)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(Resources));
            FileStream stream = new FileStream(filePath, FileMode.Open);
            Resources resources = serializer.Deserialize(stream) as Resources;
            stream.Close();
            return resources;
        }

        public static void Serialize(string filePath, Resources Resources)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(Resources));
            FileStream stream = new FileStream(filePath, FileMode.Create);
            serializer.Serialize((Stream)stream, Resources);
            stream.Close();
        }
    }
}